package io
{
	import mx.utils.UIDUtil;

	public class Global
	{
		private static var _instance:Global = null;
		
		private var packet:Packet = new Packet();
		
		function Global()
		{
			Global._instance = this;
			packet.id = UIDUtil.createUID();
			packet.actionName = "WalkCommand";
			//packet.method = "addPlay";
			packet.type = 0x02;
		}
		
		public static function instance():Global
		{
			if(_instance == null)
				_instance = new Global;
			return _instance;
		}
		
		public function packageData(data:*,method:String):Packet{
			packet.state = 0x01;
			packet.params = [data];
			packet.method = method;
			return packet;
		}
		
		public function unPackageData(pack:Packet):Object{
			return pack.result;
		}
	}
}